﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IM.Interfaces.GUI;

namespace IM.GUI.Widgets.ExtensionCommands
{
    internal class ContactListActions : IContactListActions
    {
        private static IContactListActions instance = null;

        private ContactListActions()
        {
        }

        public static IContactListActions GetInstance()
        {
            if (instance == null)
                instance = new ContactListActions();

            return instance;
        }

        public void ContactActivated(DataTypes.User user)
        {
            var registeredCommands = Mono.Addins.AddinManager.GetExtensionNodes("/IM/GUI/Widgets/ContactList/ContactActivate",
                typeof(IM.GUI.Widgets.ExtensionNodes.ContactListItemActivateNode));

            Logging.Logger.AddImportant("Contact list item activate ");
            foreach (IM.GUI.Widgets.ExtensionNodes.ContactListItemActivateNode node in registeredCommands)
            {
                node.ItemActivate(user);
            }
        }
    }
}
